package com.fasttreatment.zzr.demo.myrouter;

import android.app.Activity;
import android.content.Context;

import com.android.androidlibrary.router.Router;
import com.fasttreatment.zzr.demo.activity.ChatActivity;
import com.fasttreatment.zzr.demo.activity.CreateQrcodeActivity;
import com.fasttreatment.zzr.demo.activity.GuideActivity;
import com.fasttreatment.zzr.demo.activity.LoginActivity;
import com.fasttreatment.zzr.demo.activity.MainActivity;
import com.fasttreatment.zzr.demo.activity.QrcodeActivity;
import com.fasttreatment.zzr.demo.activity.WebActivity;

import static com.fasttreatment.zzr.demo.activity.ChatActivity.CHATID;
import static com.fasttreatment.zzr.demo.activity.WebActivity.PARAM_DESC;
import static com.fasttreatment.zzr.demo.activity.WebActivity.PARAM_URL;

/**
 * Created by zzr on 17/1/19.
 */

public class UrlRouter {
    public static void goWeb(Activity activity, String url, String desc) {
        Router.newIntent()
                .from(activity)
                .to(WebActivity.class)
                .putString(PARAM_URL, url)
                .putString(PARAM_DESC, desc)
                .launch();
    }

    public static void goMain(Activity activity) {
        Router.newIntent().from(activity).to(MainActivity.class).launch();
    }

    public static void goGuide(Activity activity) {
        Router.newIntent().from(activity).to(GuideActivity.class).launch();
    }

    public static void goQrcode(Activity activity) {
        Router.newIntent().from(activity).to(QrcodeActivity.class).requestCode(1).launch();
    }

    public static void goCreateQrcode(Activity activity){
        Router.newIntent().from(activity).to(CreateQrcodeActivity.class).launch();
    }
    public static void goLogin(Activity activity){
        Router.newIntent().from(activity).to(LoginActivity.class).launch();
    }
    public static void goChat(Activity activity,String chatId){
        Router.newIntent().from(activity).to(ChatActivity.class).putString(CHATID,chatId).launch();
    }
}
